package test05.optional.demo02;

import java.util.Optional;

/**
 * @author CSY
 * @date 2025 - 04 - 07
 */
public class MainTest04 {
    public static void main(String[] args) {
        Optional<String> optional = Optional.ofNullable("hello");
        //    public <U> Optional<U> map(Function<? super T, ? extends U> mapper) {
        String msg = optional.map(String::toUpperCase).orElse("早上好");
        System.out.println(msg);
    }
}
